Skip to content

API: Add tests for DateTimeUtil.microsToMillis#16773

Open
vishnuprakaz wants to merge 3 commits into
apache:mainfrom
vishnuprakaz:api-test-micros-to-millis
Open

API: Add tests for DateTimeUtil.microsToMillis#16773
vishnuprakaz wants to merge 3 commits into
apache:mainfrom
vishnuprakaz:api-test-micros-to-millis

Conversation

@vishnuprakaz

Copy link
Copy Markdown

Adds a unit test for DateTimeUtil.microsToMillis, which has had no direct
test since it was added in #2512.

The method was copied from Spark's DateTimeUtils and is used by Spark's
ProcedureInput. It uses Math.floorDiv, so pre-1970 timestamps round down
rather than toward zero the test covers a positive and a negative value to
keep that behavior correct

@github-actions github-actions Bot added the API label Jun 11, 2026
@vishnuprakaz

Copy link
Copy Markdown
Author

The failing test TestStructuredStreamingRead3 > testReadingStreamFromFutureTimetsamp() (async = true) is an
unrelated flaky streaming test (timing-based, relies on a fixed
Thread.sleep). This PR only adds a unit test in the api module,
and core-tests passed. Reopening to re-trigger CI

@vishnuprakaz vishnuprakaz reopened this Jun 11, 2026
}

@Test
public void microsToMillis() {

@ebyhr ebyhr Jun 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this test above microsToNanos so we can sort millis → nanos.

@vishnuprakaz

Copy link
Copy Markdown
Author

Thanks for the review! Good idea @ebyhr moved it above nanosToMicros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants